﻿using System;
using System.Windows;
using System.Windows.Controls;

namespace RG.Common.WPF.Controls
{
    public partial class MonthPicker
    {
        public MonthPicker()
        {
            InitializeComponent();
        }

        #region date Value

        public static readonly DependencyProperty ValueProperty =
            DependencyProperty.Register("Value", typeof (DateTime), typeof (MonthPicker),
                                        new FrameworkPropertyMetadata(DateTime.Now));

        public DateTime Value
        {
            set { SetValue(ValueProperty, value); }
            get { return (DateTime)GetValue(ValueProperty); }
        }
        #endregion

        private void PrevMonth_Click(object sender, RoutedEventArgs e)
        {
            Value = Value.AddMonths(-1);
        }

        private void NextMonth_Click(object sender, RoutedEventArgs e)
        {
            Value = Value.AddMonths(1);
        }
    }
}
